$(document).ready(function() {
    // set up the news accordion on the lower page
       $("#deaccordian").accordion({header: "h4" ,event: "mouseover",icons: false,autoHeight: false,navigation: true});
    $("li a:contains(Admin)").addClass('current');
    $("#boardCompare tbody tr:even").addClass("even");
    $("#boardCompare tbody tr:odd").addClass("odd");
    $("div.detail").hide();
    $("#boardCompare tbody tr").click(highlight);
    $("#mainContent  input:submit").button();

});
function highlight(evt)
{
   $("#boardCompare tbody tr").removeClass("clickrow");
   $(this).addClass("clickrow");
   var id=$(this).html();
   id=id.substring(id.indexOf(">")+1,id.indexOf("</td>"));
  // alert(id);
   id="id="+id;
   $.ajax({
        type: 'POST',
        url: base_url() + 'de/result_ajax',
        data: id,
        datatype: "json",
        success : function (result) {
          var data=$.parseJSON(result);
         // alert(data.result);

          var html="Application ID: "+data.Id+"<br/><br/>"+
              "First Name: "+data.FirstName+"<br/><br/>"+
              "Last Name: "+data.LastName+"<br/><br/>"+
              "Gender: "+data.Gender+"<br/><br/>"+
              "Permanent Address: "+data.PermAdd+"<br/><br/>"+
              "Present Address: "+data.PresAdd+"<br/><br/>"+
              "Email: "+data.Email+"<br/><br/>"+
              "DateOfBirth: "+data.Birthday+"<br/><br/>"+
              "Already Customer: "+data.AlreadyCustomer+"<br/><br/>"+
              "Result: "+data.result+"<br/><br/>";
          if(data.result=="Negative")
              html=html+"Cause: "+data.cause;
           $("div.detail div:first").html(html);
           var hidden='<input type="hidden" name="id" value='+data.Id+" />";
           if(data.result=="Negative")
                $('form#issue').remove();
           else
                $('form#reject').remove();
            
        
           $("div.process form").prepend(hidden);
           $("div.detail").slideDown("slow");



        }
    });
}

